﻿using System;
using System.Linq;

namespace CSharpLearn
{
    class Program
    {
        public enum myColor { blue, pink, green };
        static void Main(string[] args)
        {
            /*personSet();*/

            /*  string[] numbers;
              int[] num;
              numberSet(out numbers, out num);*/

            /*基本数据类型和流程控制语句*/



            /* colorEnum();*/

            /*求圆的周长和面积*/

            /*
                         round();*/


            

        }

        private static void A36()
        {
            String num = Console.ReadLine();
            int len = num.Length;
            int[] nums = new int[len];
            for (int i = 0; i < len; i++)
            {
                if (i == len - 1)
                {
                    int.TryParse(num.Substring(i), out (nums[i]));
                    break;
                }
                else
                {
                    int.TryParse(num.Substring(i, 1), out (nums[i]));
                }


            }
            Console.WriteLine("字符提取法");
            int sum = 0;
            foreach (int arr in nums)
            {
                sum += arr;
                Console.Write(arr + " ");
            }
            Console.WriteLine();
            Console.WriteLine("和为" + sum);
            Console.WriteLine("整数取余提取法");
            int num2 = int.Parse(num);
            int sum2 = 0;
            while (num2 > 0)
            {
                Console.Write(num2 % 10 + " ");
                sum2 += (num2 % 10);
                num2 /= 10;
            }
            Console.WriteLine();
            Console.WriteLine("和为" + sum2);
            Console.ReadLine();
        }


        private static void round()
        {
            double r;
            Console.WriteLine("请输入半径:");
            r = double.Parse(Console.ReadLine());
            round r1 = new round(r);
            Console.WriteLine("面积为:" + r1.getS());
            Console.WriteLine("周长为:" + r1.getL());
        }

        private static void colorEnum()
        {
            string[] names = Enum.GetNames(typeof(myColor));

            foreach (var color in names)
            {
                Console.WriteLine(color);
            }
        }

        private static void numberSet(out string[] numbers, out int[] num)
        {
            numbers = Console.ReadLine().Split(" ");
            num = new int[numbers.Length];
            for (int i = 0; i < num.Length; i++)
            {
                num[i] = int.Parse(numbers[i]);
            }
            Console.WriteLine(num[0] + num[1]);
            Console.WriteLine(num[0] - num[1]);
            Console.WriteLine(num[0] * num[1]);
        }

        private static void personSet()
        {
            person person1 = new person();
            Console.WriteLine(person1.ToString());


            string name = Console.ReadLine();
            name.Split(',');
            Console.WriteLine("your name is " + name);
            var c = Console.ReadKey();
            ConsoleKeyInfo info = Console.ReadKey();
            if (info.Key == ConsoleKey.A)
            {
                Console.WriteLine("你的输入为A");
            }
            else
            {
                Console.WriteLine("你的输入不是A");
            }
        }
    }
}
